package com.distribution.system.controller;


import com.distribution.common.core.controller.BaseController;
import com.distribution.common.core.domain.AjaxResult;
import com.distribution.system.domain.entity.CmccDaOrder;
import com.distribution.system.domain.entity.FuluUploadPlan;
import com.distribution.system.scheduler.OrderScheduling;
import com.distribution.system.service.FuluUploadPlanService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


/**
 * 
 * (CmccDaCommissionReflection)表控制层
 * @author 
 * @since 2023-05-21 20:06:19
 */
@RestController
@RequestMapping(value = "/fuluUploadPlan")
@Slf4j
public class FuluUploadPlanController extends BaseController {
    @Resource
    FuluUploadPlanService fuluUploadPlanService;

    @Resource
    OrderScheduling orderScheduling;


    @PostMapping(value = "/queryPayMethod")
    public AjaxResult queryPayMethod() {
        List<Object> jsonArray = fuluUploadPlanService.queryPayMethod();
        return success(jsonArray);
    }


    @PostMapping(value = "/uploadPlan")
    public AjaxResult uploadPlan(@RequestBody FuluUploadPlan fuluUploadPlan) {
        return success( fuluUploadPlanService.uploadPlan(fuluUploadPlan));
    }

    @PostMapping(value = "/queryPlan")
    public AjaxResult queryPlan(@RequestBody FuluUploadPlan fuluUploadPlan) {
        String result = fuluUploadPlanService.queryPlan(fuluUploadPlan);
        return success(result);
    }

    @PostMapping(value = "/uploadEvidence")
    public AjaxResult uploadEvidence(@RequestBody CmccDaOrder cmccDaOrder) {
        fuluUploadPlanService.uploadEvidence(cmccDaOrder);
        return success();
    }

    @PostMapping(value = "/autoUploadEvidence")
    public AjaxResult autoUploadEvidence() {
        orderScheduling.autoUploadEvidence();
        return success();
    }
}
